Skip to main content

Database Search Node

The Database Search node lets you query a connected SQL database using natural language or explicit search text. It returns a list of tables (and optional aliases) that match your criteria, which you can then use in downstream SQL actions or function calls.


🔧 Configuration Panel

When you expand the node, you’ll see three main sections:

  1. Model & Instruction
  2. Search Text
  3. Database & Table Selection

⚙️ 1. Model & Instruction

  • Header Bar: Shows the current LLM model (gpt-4) and the “Instruction” label.
  • Usage: Click the pencil icon to add an optional system prompt that guides how the AI matches tables.
Model: gpt-4   Instruction: [edit…]

⚙️ 2. Search Text

  • Field: Search Text

  • Type: Text input

  • Purpose: A short phrase or keyword that describes the table(s) you want to find.

  • Example:

    • user profile
    • transactions in the last 30 days
    • customer orders summary
Search Text: [ Enter your keywords… ]

The AI will use this text to rank and surface relevant tables from the selected database.


⚙️ 3. Database Name

  • Field: Database Name (required)
  • Type: Dropdown
  • Options: All databases you’ve connected (e.g. digisquaresmysql, Default: MySQL).
  • Purpose: Choose which data source to search in.

⚙️ 4. Table Name & Alias

Once you hit OK, the node will populate a table of matching results:

Table NameAlias
customerscust
orders
transaction_logtx_log
  • Table Name: The actual schema name in your database.
  • Alias: (Optional) A shorthand you can assign to refer to this table in later SQL or function calls.
How to use aliases
  • In subsequent SQL nodes, reference cust instead of customers for brevity:

    SELECT cust.name, cust.email FROM customers AS cust;

🚀 Best Practices

  • Be specific in your search text to avoid broad results (e.g. “monthly sales” rather than just “sales”).
  • Choose the correct database if you have multiple connections.
  • Assign aliases to avoid long table names in your code.
  • Review results visually in preview mode before running queries.
  • Combine with JSON Instruction or Function Calling to programmatically build full SQL statements using the tables you select.
Example flow:
1. Database Search → fetch “transactions” from `digisquaresmysql`
2. JSON Instruction → build JSON payload { "table": "transaction_log", "alias": "tx" }
3. Function Calling → run `queryDatabase` with this payload

By leveraging the Database Search node, you can quickly discover and reference the right tables without memorizing your schema.